home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
batchlrn.arc
/
GOTO.HLP
< prev
next >
Wrap
Text File
|
1991-06-17
|
3KB
|
40 lines
|---------------B A T C H L R N H E L P S Y S T E M-----------------|
|command: GOTO |
|use: The GOTO command is a batch file-only command. It is used to |
| perform a "jump" from the GOTO <label> to the :<label>. After the |
| :<label> (the SECOND one) the program performs the commands listed. |
| In"computereze"this is described as:the GOTO command directing the |
| program to perform the command following the item described in the |
| command modifier (so much for that!). |
| |
|how:Type: GOTO <LABEL> (in a batch file), THEN type:<LABEL> later on |
| for a series of commands to be performed. |
| |
|when:GOTO is used in conjunction with (usually) some IF condition |
| or to create a loop function. |
| |
|examples: In a condition situation you would have SEVERAL GOTOs. For |
| example, IF %1 exists GOTO label 1 (next line) IF %1 not exist GOTO |
| label#2. Elsewhere in the batch file :label#1 AND :label#2 would |
| both be present, followed by commands you want performed depending |
| on whether %1 existed or not. USUALLY you create another jump at the|
| end of each :label command set with GOTO END, with the :END label |
| wrapping up the batch processing no matter what else occured in the |
| previous portions of the file. SEE sample batch files on this disk! |
|more examples:(To create a GOTO loop): 1) :spot |
| this is what you would 2) REM This is a loop |
| program (3 lines) 3) GOTO spot |
| That would cause an infinite sequence of messages to be displayed: |
| A>REM This is a loop |
| A>GOTO spot |
| A>REM This is a loop |
| A>GOTO spot |
| A>REM This is a loop . . . . etcetera (on & on til you stop it!) |
|NOTES: If you do not include <label> in the GOTO command, the batch |
| processing file stops. Any line in a batch file that starts with ":"|
| is treated as a label but otherwise ignored. DOS only recognizes the|
| FIRST EIGHT characters in a label. To stop an endless loop GOTO file|
| use CTRL-BREAK or CTRL C. |
| |
|----------------- T I M E M A S T E R ---------------------|